package cn.gok.io;

import java.io.FileReader;
import java.io.IOException;
import java.io.Reader;
import java.util.Properties;
import java.util.Set;

/**
 * @ClassName Properties工具
 * @Description TODO
 * @Author HP
 * @Date 17:01 2022/7/7
 * @Version 1.0
 **/
public class Properties工具
{
    public static void main(String[] args) throws IOException {
        Properties properties = new Properties();
        properties.setProperty("name","laobai");
        properties.setProperty("passwd","123456");

        System.out.println(properties);

        Reader rd = new FileReader("");

        properties.load(rd);
        System.out.println(properties.getProperty("name"));

        Set<String> keys = properties.stringPropertyNames();

        for (String s:keys){
            System.out.println(s);
            System.out.println(properties.getProperty(s));
        }
    }
}
